package com.alex.demo.springtest.service;

import org.springframework.stereotype.Service;

import com.alex.demo.springtest.bean.BigCar;

@Service("testService")
public class TestService {

	public BigCar addColor(String color) throws Exception {
		BigCar bigCar = new BigCar();
		System.out.println("请先输入颜色");
		if (!color.equals("黑色")) {
			throw new Exception("输入的颜色不合理,请重新输入");
		}
		bigCar.setColor(color);
		return bigCar;
	}
}
